package com.chen.dao;

import com.chen.model.Goods;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface GoodsDao {

    @Select("select * from goods where goods_id=#{goods_id}")
    Goods findGoodsById(Integer goods_id);

    @Insert("insert into goods values (#{goods_id},#{goods_name},#{goods_number})")
    int addGoods(Goods goods);

    @Select("select * from goods")
    List<Goods> findAllGoods();

    @Update(" update goods set goods_number=#{goods_number} where goods_id=#{goods_id}")
    int updateGoods(Goods goods);
}
